#include <stdio.h>
#include <time.h>

int main(int argc, char const *argv[])
{
    time_t tSec;
    time(&tSec);
    printf("sec = %ld\n", tSec);

    char *pTime = ctime(&tSec);
    printf("pTime = %s\n", pTime);

    struct tm *pLocalTime = localtime(&tSec);
    printf("%4d-%02d-%02d %02d:%02d:%02d\n",
            pLocalTime->tm_year+1900, pLocalTime->tm_mon+1, pLocalTime->tm_mday,
            pLocalTime->tm_hour, pLocalTime->tm_min, pLocalTime->tm_sec);
    

    
    return 0;
}

/*
time函数
ctime函数
localtime函数
*/